﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace XMM.Dialoges.Library
{
    /// <summary>
    /// Interaktionslogik für PlotEditor.xaml
    /// </summary>
    public partial class PlotEditor : Window
    {
        string Plot { get; set; }

        Controls.Library.Holster_Plot ParentPlotHolster { get; set; }

        public PlotEditor(Controls.Library.Holster_Plot ctlPlotHolster, string sPlot)
        {
            InitializeComponent();

            Plot = sPlot;

            ParentPlotHolster = ctlPlotHolster;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            txtPlot.Text = Plot;
        }

        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ParentPlotHolster.Plot = txtPlot.Text;
            ParentPlotHolster.setStatusImage(true);
            Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
